/*
 * config.h
 *
 *  Created on: 2012-3-21
 *      Author: ncrd
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#include <string>
#include <libxml/parser.h>
#include <libxml/tree.h>

using namespace std;

#define DEVICE_NAME         "/dev/dp83640_driver"
#define DP83640_IOC_MAGIC   'D'
#define MODE_SET            _IOW(DP83640_IOC_MAGIC,17,int)
#define ETE_MODE            0
#define PTP_MODE            1
#define SHM_SIZE 			1024
#define SHM_MODE 			0600
#define PTP_FLAG_FILE		"/etc/PTP/FLAG" //表示ptp程序是否正在运行
#define LOG_FILE			"/var/IEEE1588log"
#define SYNC_FILE			"/etc/PTP/SYNC"
#define SYSTEM_IFCFG_FILE	"/etc/sysconfig/network-scripts/ifcfg-eth0"
#define LOCAL_IFCFG_FILE	"/mnt/etc/sysconfig/network-scripts/ifcfg-eth0"

string get_config(string);

int set_config(string, string);

xmlDocPtr OpenXML(const char *);

int reset_config(void);

int save_config(void);

int abort_save_config(void);

#endif /* CONFIG_H_ */
